import scrapy
import pymongo
class SearchSpider(scrapy.Spider):
    name = "office"

    def start_requests(self):
        for i in range(1,12):
            url = "http://www.caam.org.cn/newslist/a96-%s.html"
            yield scrapy.Request(url%i, callback=self.parse, )



    def parse(self, response):
        description = response.css("head > meta[name=description]::attr(content)").extract_first()
        keywords = response.css("head > meta[name=keywords]::attr(content)").extract_first()
        title = response.css("head > title::text").extract_first()
        url = response.url
        return {
            'description': description,
            'keywords': keywords,
            'title': title,
            'url': url,
            'html': response.text,
        }
        pass

